<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的评价</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/swiper.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/layer.css" />
    <link rel="stylesheet" type="text/css" href="../css/mdw.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/swiper.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/layer.js"></script>
    <script type="text/javascript" src="../script/mdw.js"></script>
    <script type="text/javascript" src="../script/jumpPage.js"></script>

</head>
<body class="bg-eee">
    <header class="header">
        <div class="backPrevPage on" onclick="historyBack()"></div>
        <div class="pageTitle">商品评价</div>
        
    </header>
    <section class="evaluatePage HTML_BOX">
        <div class="bg-eee" style="border-bottom:.2rem solid #EEE ; "></div>
        <ul class="evaList">
           
        </ul>
        
    </section>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
    var page =1;
    var param;
    var ifpage = true;
    apiready = function(){
        $api.fixStatusBar($api.dom('header'));
        api.setStatusBarStyle({
            color: '#fff',//设置APP状态栏背景色
            style: 'dark'
        });
        api.addEventListener({
            name: 'scrolltobottom',
            extra: {
                 threshold: 10
            }
         }, function(ret, err) {
             //页码+1，继续请求数据
             if(ifpage){
                page++;
                ready();
             }
        });
        param = api.pageParam;
        ifCnAndEn();
        ready();
    };
    function ready(){
        pop.loading();
        getAjax(Interface.product_comment,{token:token,page:page,id:param.id},function(res){
            console.log(JSON.stringify(res));
            var list = res.data;
            if(page==1){
                $(".evaList").empty();
            }
            if(list){
                $(".pageHide").addClass("dn");ifpage=true;
                $.each(list,function(i,item){
                    var html ='';
                    html += '<li><div class="evaBox1 displayFlex">';
                            html += '<div class="userinfo">';
                                    html += '<div class="userImg">';
                                            html += '<img src="'+getImg(item.icon)+'" />';
                                        html += '</div>';
                                        if(!item.username){
                                            if(item.mobile.length == 11){
                                                var mobile = item.mobile.substr(0,3)+"****"+item.mobile.substr(7);
                                                item.username = mobile;
                                            }else{
                                                item.username = "匿名用户";
                                                if(cnen==2){
                                                    item.username ='Anonymous User';
                                                }
                                            }
                                        }
                                        html += '<div class="userName">'+item.username+'</div>';
                                        html += '<div class="evaLvl ">';
                                        for(var index = 0; index<item.star;index++){
                                            html+='<i class="on"></i>';
                                        }
                                        html += '</div>';
                                    html += '</div>';
                                    html += '<div>'+timestampToTime(item.create_time)+'</div>';
                                html += '</div>';
                                html += '<div class="evaBox2">'+item.content+'</div>';
                                html += '<div class="evaBox4">';
                                    // <img src="../image/ware_2.png" />
                                    // <img src="../image/ware_3.png" />
                                html += '</div>';
                               // html += '<div class="evaBox5">2斤约12个</div>';
                            html += '</li>';
                    $(".evaList").append(html);
                })
                if(list.length<10){
                    $(".getPage").hide();
                }
            }else{
                 ifpage=false;
                 if(page==1){$(".pageHide").removeClass("dn");}
            }
            pop.close();
        },function(res,err){})
    }
    
</script>
<script type="text/javascript">
    function ifCnAndEn(){
        if(cnen==2){
            $(".pageTitle").eq(0).html('Ware Reviews');
        }
    }
</script>
</html>